<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		* {
			margin: 0;
			padding: 0;
		}
		div {
			width: 200px;
			height: 200px;
			background-color: red;
			margin-bottom: 10px;
		}
	</style>
</head>
<body>
	<div></div>
	<div></div>
	<script>
		var startX, startY, moveX, moveY, distanceX, distanceY;
		document.addEventListener('touchstart', function (e) {
			startX = e.targetTouches[0].clientX;
			startY = e.targetTouches[0].clientY;
		});
		document.addEventListener('touchmove', function (e) {
			moveX = e.targetTouches[0].clientX;
			moveY = e.targetTouches[0].clientY;
			distanceX = moveX - startX;
			distanceY = moveY - startY;
			e.target.style.transform = 'translate( '+distanceX+'px, '+distanceY+'px)';
		}); 

	</script>
</body>
</html>